package cn.bocweb.spinning.view.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by chenchangxing on 15/12/21.
 */
public class CollectAdapter extends FragmentPagerAdapter {

    List<Fragment> list;
    public CollectAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {

        return list.get(position);
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0: {
                return "资讯";
            }
//            case 1: {
//                return "产品";
//            }
//            case 2: {
//                return "企业";
//            }
            case 1: {
                return "话题";
            }
        }
        return null;
    }
}
